package com.jason.www.pojo;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class News implements Serializable {
    private String title;
    private String tag;
    private Date publishTime;

    public News() {
    }

    public News(String title, String tag, String publishTime) {
        LocalDateTime localDateTime = LocalDateTime.parse(publishTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        this.title = title;
        this.tag = tag;
        this.publishTime = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }
}
